/**
 * 注册
 */
function onSign(){
    const sign = document.querySelector('.sign_wraper form')
    const userInput = document.querySelector('input[name="username"]')
    const passwordInput = document.querySelector('input[name="password"]')
    sign.addEventListener('submit',function(e){
        e = e || window.event
        e.preventDefault()  // 阻止默认行为

        let username = userInput.value
        let password = passwordInput.value
        // 非空验证
        // 密码强度验

        // 调用注册接口注册用户
        myPromise({
            method:'post',
            url:'http://10.7.162.150:8089/api/member/add',
            data:{
                username,
                password
            }
        }).then(res=>{
            alert('注册成功!')
        }).catch(err=>{
            alert(err)
        })

    })
}

onSign()